package com.test.datasource.demo.com.controller;

import com.test.datasource.demo.com.user.UserService1;
import com.test.datasource.demo.com.user2.UserService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {

    @Autowired
    UserService1 userService1;

    @Autowired
    UserService2 userService2;

    @RequestMapping("/insertUser1")
    public String insertUser1 () {
        userService1.insertUser();
        return "userService1 success";
    }

    @RequestMapping("/insertUser2")
    public String insertUser2 () {
        userService2.insertUser();
        return "userService2 success";
    }

    @RequestMapping("/allInsert")
    public String allInsert () {
        userService1.allInsert();
        return "userService2 success";
    }
}
